package com.erp.erp_dao.Email;

import com.erp.erp_entitys.Email.*;
import com.erp.erp_entitys.warehouse.entity.AnnexEntity;

import java.util.ArrayList;
import java.util.List;

public interface EmailDao {
    //将读取协议信息从数据库拉取出来
    List<email_Pop3> selectAllEmail_Pop3();
    List<email_Pop3> selectAllEmail_Pop3NotStatue();
    List<email_Pop3> selectAllEmail_Pop3byUserCode(String code);

    // 删除草稿箱邮件
    void deleteCaoEmail(Integer id);
    //根据pop3id获取全部邮件并根据时间排序
    List<email_email> selectAllEmailBypop3IDS(emailOrder order);

    void updateEmail_Pop3(int pop3_id, String uid);
    void updateSendEmail_Pop3(int pop3_id, String uid);

    int addEmail_email(email_email email);

    void insertEmail_adjunct(email_adjunct email_adjunct);

    List<email_adjunct> selectAdjunctForEmail_ID(int email_id);

    List<email_adjunct> selectAllAdjunct();

    email_adjunct selectAdjunctForAdjunct_ID(int adjunct_id);

    email_email selectEmailByEmail_id(int email_id);

    email_Pop3 selectPOP3Bypop3_id(int pop3_id);

    void updateEmail_emailReady1(int email_id);
    void updateEmail_emailReady2(int email_id);
    void updateUpAdjunct(email_adjunct adjunct);

    List<email_email> selectAllEmailbyPOP3_id(int pop3_id);

    //新建箱子
    int insertBox(email_box box);

    //箱子加入邮件
    void insertBox_Email(email_box_emailid emailid);

    //查询用户所有的箱子
    List<email_box> selectAllBox(String code);

    //查询用户的查询箱子id
    email_box selectSearchBox(String code);

    //查询箱子所有邮件id
    List<email_email> selectEmailForBoxID(int boxID);

    //根据邮件id批量查询邮件
    List<email_email> selectEmailForEmailID(List<Integer> emailIDs);

    //删除箱子
    void deleteBox(int boxID);

    //删除箱子内邮件
    void deleteBox_email(int boxID);

    //新建规则
    int insertSearch(searchEmail searchEmail);

    //删除规则
    void deleteSearch(int searchID);

    //查询规则
    searchEmail selectSearch(int searchID);

    //pop3增删改
    void insertPop3(email_Pop3 pop3);

    void updatePop3(email_Pop3 pop3);

    void deletePop3(int pop3id);

    //stmp增删改查
    void insetStmp(email_smtp smtp);

    void updateStmp(email_smtp smtp);

    void deleteStmp(int smtoID);

    List<email_smtp> selectStmp(String code);

    email_smtp selectStmpById(int stmpid);

    //新增群发
    void insertEmail_mass(email_mass mass);

    void insertTag(int emailID, String tag);

    void deleteTag(int emailID);

    void insertStar(int emailID);

    void deleteStar(int emailID);

    List<email_email> selectAllEmailbyPOP3_idNoReady(int pop3_id);

    List<email_email> selectAllEmailNoReady();

    List<email_email> searchEmail(searchEmail searchEmail);

    void changeXinbiao0(Integer emailID);

    void changeXinbiao1(Integer emailID);

    void changeTag(Tag tt);

    List<email_email> selectApproveEmailByCode(String code);

    List<email_email> selectEmailByGaoji(searchEmail search);

    email_box selectBoxById(Integer box_id);

    void updateSearch(searchEmail search);

    void updateBox(email_box box);

    void updateEmailClass(changeEmailClass chage);

    void changeEmailReady(changeEmailReady chage);

    void changeAllEmailReady(List<email_Pop3> pop3s);

    List<email_email> selectEmailByAnswer(List<email_Pop3> pop3s);

    List<email_email> selectEmailByready(List<email_Pop3> pop3s);

    void updateReadStatue(Integer emailID);

    int insertEmail_account(email_account account);

    void deleteEmail_account(email_account account);

    List<email_account> selectEmail_accountBycode(String code);

    void updateEmail_account(email_account account);

    email_account selectEmail_accountById(Integer ccid);

    void updateEmail_accountStatues();

    void updateEmail_Pop3Statues();

    void updateEmail_SmtpStatues();

    void insertTemplate(email_template template);

    void deleteTemplate(email_template template);

    void updateTemplate(email_template template);

    List<email_template> selectTemplates(String code);

    email_template selectTemplateByid(Integer template_id);

    void inserteDeploy(email_deploy deploy);

    email_deploy selectDeploy(String code);

    void updateDeploy(email_deploy deploy);

    List<email_email> selectdraft(String code);

    List<email_box_emailid> selectEmailForBoxIsExist(Integer boxid, Integer emailid);
    List<email_box_emailid> selectAllEmailForBoxIsExist(Integer emailid);
    void insertEmailRules(EmailRules rule);

    List<EmailRules> selectEmailRulesBycode(String code);

    EmailRules selectEmailRulesByID(Integer id);

    void updateEmailRules(EmailRules rule);

    void deleteEmailRules(Integer id);

    void updateTemplateNodefault(String code);

    email_email selectnotFind(String address);

    Integer selectNowEmail(email_nowEmail ne);

    void insetSendMessage(send_message send_message);

    void deleteSend_message(int id);

    List<send_message> selectSendMessage();

    email_email selectReuse(email_email email);

    Integer selectNoRead(List<email_Pop3> pop3s);

    void ReturnEmailByBoxId(List<email_email> emails);
    void ReturnEmailByBoxId1(List<email_email> emails);

    List<email_email> selectLastMessage(int pop3_id);
    List<email_email> selectLastSendMessage(int pop3_id);

    email_email selectEmailBysenderAddresser(searchEmail searchEmail);

    void deleteMuchEmail();
    void addAuto(emailAuto auto);
    void deleteAuto(emailAuto auto);
    List<emailAuto> selectAuto();

    void deleteEmailInBox(int email_id);

    List<searchEmail> selectSearchTmp(String address);

    email_box selectBoxBySearch(int search_id);
    email_box selectCustorBoxBySearch(int search_id);

    void updateEmailByCreateDate(email_email ramEmail);
    //查询各个箱体的总数和未读数
    List<emailReadNum> selectEmailReadNum(List<Integer> pop3s);

    email_box selectUserBoxByTwoCode(String code, String code1);

    List<email_box> selectChangeBox(String code);
    List<email_box> selectCustorBox(String code);
    //修改用户箱和客户箱增删改查
    void insertEmailCustor(email_custor email_custor);
    List<email_custor> selectEmailCustor();
    void deleteEmailCustor(email_custor email_custor);
    void updateEmailCustor(email_custor email_custor);

    List<searchEmail> selectSearchBySendAddress(String senderAddresser);

    List<searchEmail> selectSearchBySendAddress1(String senderAddresser);
    List<email_box> selectUserBoxByoneCode(String code);

    void setEmailSize(int id, int size);

    List<email_email> selectEmeilBySuject();

    void updateSubject(int email_id, String strr);

    List<AnnexEntity> selectAllFileNmae();

    List<email_email> selectCustorShowEmailByPage(ArrayList<String> emails);

    Integer checkEmailMore(email_email email);

    void deleteContext(Integer emailID);

    /**
     * 根据条件查询邮件
     * @param email
     * @return
     */
    List<email_email> selectEmailByParam(email_email email);

}
